import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/tabs'
  },
  {
    path: '/login',
    component: () => import('@/views/login/index')
  },
  {
    path: '/tabs',
    redirect: '/tabs/home'
  },
  {
    path: '/tabs',
    component: () => import('@/views/tabscontainer/index'),
    children: [
      {
        path: 'home',
        name:"home",
        component: () => import('@/views/home/index')
      },
      {
        path: 'classification',
        name:"classification",
        component: () => import('@/views/classification/index')
      },
      {
        path: 'shoppingcart',
        name:"shoppingcart",
        component: () => import('@/views/shoppingcart/index')
      },
      {
        path: 'usercenter',
        name:"usercenter",
        component: () => import('@/views/usercenter/index')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
